/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("tb_project_subjectexpensedetailinfo",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using MYData.Entity.DomainModels;
using MYData.System.IServices;
using MYData.Entity.DTO.ApiEntity.Input;
using Microsoft.AspNetCore.Authorization;
using Mapster;
using System.Net;
using MYData.Core.Utilities;
using Microsoft.AspNetCore.Components.Forms;

namespace MYData.System.Controllers
{
    public partial class tb_project_subjectexpensedetailinfoController
    {
        private readonly Itb_project_subjectexpensedetailinfoService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;

        [ActivatorUtilitiesConstructor]
        public tb_project_subjectexpensedetailinfoController(
            Itb_project_subjectexpensedetailinfoService service,
            IHttpContextAccessor httpContextAccessor
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
        }

        /// <summary>
        /// 添加科目报销信息
        /// </summary>
        /// <param name = "inputDto" ></ param >
        /// < returns ></ returns >
        [HttpPost, Route("InsertSubjectExpenseInfo"), AllowAnonymous]
        public IActionResult InsertSubjectExpenseInfo([FromBody] SubjectExpenseInput_Dto inputDto)
        {
            return Json(_service.InsertSubjectExpenseInfo(inputDto));
        }

        /// <summary>
        /// 修改科目实体信息
        /// </summary>
        /// <returns></returns>
        [HttpPost, Route("UpdateSubjectExpenseInfo"), AllowAnonymous]
        public IActionResult UpdateSubjectExpenseInfo([FromBody] SubjectExpenseUpdate_Dto inputDto)
        {
            return Json(_service.UpdateSubjectExpenseInfo(inputDto));
        }
        /// <summary>
        /// 根据科目ID获取实体信息
        /// </summary>
        /// <param name="SubjectId"></param>
        /// <returns></returns>
        [HttpPost, Route("GetSubjectExpenseInfo"), AllowAnonymous]
        public IActionResult GetSubjectExpenseInfo(string SubjectId)
        {
            return Json(_service.GetSubjectExpenseInfo(SubjectId));
        }

        [HttpGet, Route("GetIsJudge"), AllowAnonymous]
        public IActionResult GetIsJudge(string subjectId)
        {
            return Json(_service.GetIsJudge(subjectId));
        }
    }
}
